package com.imchen.cms.cmscommon.utils;
 

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

/**
 * MD5加密工具
 *
 * @author imchen
 */
public class MD5Util {
 
    private static final String SALT = "12345678";
 
    public static String encode(String password) {
        try {
            MessageDigest md=MessageDigest.getInstance("MD5");
            md.update(password.getBytes());
            return new BigInteger(1,md.digest()).toString(16);
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }
        return null;
    }
 
    public static void main(String[] args) {
        System.out.println(MD5Util.encode("123123"));
 
 
    }
}
